# frozen_string_literal: true
class EditorPolicy < ApplicationPolicy
  class Scope < Scope
    def resolve
      if admin?
        scope.all
      else
        scope.where(id: editor.id)
      end
    end
  end

  def index?
    admin?
  end

  def new?
    admin?
  end

  def destroy?
    admin?
  end

  def create?
    admin?
  end

  def edit?
    admin?
  end

  def update?
    admin?
  end
end
